//
//  MSG_BOX_CANCEL_BTN.m
//  ICE_Player
//
//  Created by xl on 11-7-10.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <QuartzCore/QuartzCore.h>
#import "MSG_BOX_CANCEL_BTN.h"


@implementation MSG_BOX_CANCEL_BTN


- (id)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code.
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code.
}
*/

- (void)dealloc {
	[self destroy_SubViews];
    [super dealloc];
}

- (void) setHidden:(BOOL)enabled
{   
    if (enabled)
    {
        CATransition *animation = [CATransition animation];
        animation.delegate = self;
        animation.duration = 0.15f;
        animation.timingFunction = UIViewAnimationCurveEaseInOut;
        animation.fillMode = kCAFillModeForwards;//kCAFillModeBackwards;//
        animation.type = kCATransitionFade;//@"rippleEffect";//110
        //animation.subtype = kCATransitionFromRight;//kCATransitionFromTop;
        //animation.endProgress = 1.0;
        //animation.removedOnCompletion = NO;
        
        //[self.layer addAnimation:animation forKey:@"animation"];
        [self.layer addAnimation:animation forKey:@"animation"];
        
    }
    else
    {
        CATransition *animation = [CATransition animation];
        animation.delegate = self;
        animation.duration = 0.15f;
        animation.timingFunction = UIViewAnimationCurveEaseInOut;
        animation.fillMode = kCAFillModeForwards;//kCAFillModeBackwards;//
        animation.type = kCATransitionFade;//@"rippleEffect";//110
        //animation.subtype = kCATransitionFromRight;//kCATransitionFromTop;
        //animation.endProgress = 1.0;
        //animation.removedOnCompletion = NO;
        
        //[self.layer addAnimation:animation forKey:@"animation"];
        [self.layer addAnimation:animation forKey:@"animation"];
    }
    
	super.hidden = enabled;
}

- (void)create_SubViews:(UIViewController*)controller
{
    [super create_SubViews:controller];
}

- (void)destroy_SubViews
{
}

@end
